﻿using University.Workshop.Model;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using University.Workshop.ServerApp;

namespace University.Workshop.Tests
{
    
    
    /// <summary>
    ///This is a test class for UserChipsBuyTest and is intended
    ///to contain all UserChipsBuyTest Unit Tests
    ///</summary>
    [TestClass()]
    public class UserChipsBuyTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for LogInCreditCard
        ///</summary>
        [TestMethod()]
        public void LogInCreditCardTest()
        {

            PokerServer server = new PokerServer();
            server.InitializeServer(3000);
            
            UserChipsBuy target = new UserChipsBuy(); // TODO: Initialize to an appropriate value
            string name = "Roberto"; // TODO: Initialize to an appropriate value
            string cardNumber = "4"; // TODO: Initialize to an appropriate value
            bool expected = true; // TODO: Initialize to an appropriate value
            bool actual;
            actual = target.LogOnCreditCard(name, cardNumber);
            Assert.AreNotEqual(expected, actual);
           //Assert.Inconclusive("Verify the correctness of this test method.");
            server.DisconnectServer();
        }

        /// <summary>
        ///A test for LogInCreditCard
        ///</summary>
        [TestMethod()]
        public void LogInCreditCardTest1()
        {
            PokerServer server = new PokerServer();
            server.InitializeServer(3000);

            UserChipsBuy target = new UserChipsBuy(); // TODO: Initialize to an appropriate value
            //string name = "Luis"; // TODO: Initialize to an appropriate value
            //string cardNumber = "7"; // TODO: Initialize to an appropriate value
            string name = "Roberto"; // TODO: Initialize to an appropriate value
            string cardNumber = "8";
            bool expected = false; // TODO: Initialize to an appropriate value
            bool actual;
            actual = target.LogOnCreditCard(name, cardNumber);
            Assert.AreEqual(expected, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
            server.DisconnectServer();
        }

        /// <summary>
        ///A test for ConsultAmount
        ///</summary>
        [TestMethod()]
        public void ConsultAmountTest()
        {
            PokerServer server = new PokerServer();
            server.InitializeServer(3000);

            UserChipsBuy target = new UserChipsBuy(); // TODO: Initialize to an appropriate value
            string numCard = "46"; // TODO: Initialize to an appropriate value
            string name = "Roberto"; // TODO: Initialize to an appropriate value
            string expected = "Doesn'tFound"; // TODO: Initialize to an appropriate value
            string actual;
            actual = target.ConsultAmount(numCard, name);
            Assert.AreEqual(expected, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
            server.DisconnectServer();
        }

        /// <summary>
        ///A test for ConsultAmount
        ///</summary>
        [TestMethod()]
        public void ConsultAmountTest1()
        {
            PokerServer server = new PokerServer();
            server.InitializeServer(3000);

            UserChipsBuy target = new UserChipsBuy(); // TODO: Initialize to an appropriate value
            string numCard = "12"; // TODO: Initialize to an appropriate value
            string name = "Roberto"; // TODO: Initialize to an appropriate value
            string expected = "Doesn'tFound"; // TODO: Initialize to an appropriate value
            string actual;
            actual = target.ConsultAmount(numCard, name);
            Assert.AreEqual(expected, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
            server.DisconnectServer();
        }

        /// <summary>
        ///A test for changeAmount
        ///</summary>
        [TestMethod()]
        public void changeAmountTest()
        {
            PokerServer server = new PokerServer();
            server.InitializeServer(3000);

            UserChipsBuy target = new UserChipsBuy(); // TODO: Initialize to an appropriate value
            string numCard = "4"; // TODO: Initialize to an appropriate value
            string amount = "10"; // TODO: Initialize to an appropriate value
            string operation = "sum"; // TODO: Initialize to an appropriate value
            string name = "Roberto"; // TODO: Initialize to an appropriate value
            string expected = "true"; // TODO: Initialize to an appropriate value
            string actual;
            actual = target.ChangeAmount(numCard, amount, operation, name);
            Assert.AreEqual(expected, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
            server.DisconnectServer();
        }

        /// <summary>
        ///A test for changeAmount
        ///</summary>
        [TestMethod()]
        public void changeAmountTest1()
        {
            PokerServer server = new PokerServer();
            server.InitializeServer(3000);

            UserChipsBuy target = new UserChipsBuy(); // TODO: Initialize to an appropriate value
            string numCard = "78"; // TODO: Initialize to an appropriate value
            string amount = "10"; // TODO: Initialize to an appropriate value
            string operation = "sum"; // TODO: Initialize to an appropriate value
            string name = "Roberto"; // TODO: Initialize to an appropriate value
            string expected = "false"; // TODO: Initialize to an appropriate value
            string actual;
            actual = target.ChangeAmount(numCard, amount, operation, name);
            Assert.AreNotEqual(expected, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
            server.DisconnectServer();
        }
    }
}
